﻿@model KBVault.Web.Models.CategoryViewModel

@{
    ViewBag.Title = String.Format(UIResources.CategoryEditFormPageTitle, Model.Name);
    Layout = "~/Views/Shared/_Admin_Layout.cshtml";
}

@section Scripts{
    $("#Name").slugIt({output:"#SefName",events:"blur"});
}

@section ContentHeader{
    <h1>
        @ViewBag.Title
        <!-- <small>Control panel</small> -->
    </h1>
   
}


@using (Html.BeginForm())
{
    @Html.HiddenFor(m => m.Id)
    @Html.ValidationSummary()
    <br />
    <div class="form-group">
        <label for="Name">@UIResources.CategoryCreateFormLabelCategory</label>
        <input type="text" class="form-control" id="Name" name="Name" value="@Model.Name" />
    </div>
    <div class="form-group">
        <label for="SefName">@UIResources.CategoryCreateFormSefNameLabel</label>
        <input type="text" class="form-control" id="SefName" name="SefName" value="@Model.SefName" />
    </div>
    <div class="form-group">        
        <div class="checkbox">
            <label>
                <input type="checkbox" name="IsHot" value="true" checked="@Model.IsHot" />@UIResources.CategoryCreateFormLabelIsHot
            </label>
        </div>
    </div>
    <div class="form-group">
        <label for="ParentId">@UIResources.CategoryCreateFormLabelParent</label>
        @Html.DropDownListFor(m => m.ParentId, KBVaultHelperFunctions.CategoryTreeForSelectList(Model.ParentId), new { @class = "form-control" })
    </div>
    <div class="form-group">
        <input type="submit" class="btn btn-default" value="@CommonResources.ButtonSave" />
    </div>
    
}